<?
function head() {
	return <<<qq
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--

Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Title      : Stickybud
Version    : 1.0
Released   : 20070701
Description: A two-column, fixed-width template. This template features a splash page that can be changed easily.

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>PHP Color Tools</title>
	<meta name="keywords" content="php, graph, percent, percentage, calculate, calculate percentage, open source, download, bar graph, bar-graph, bargraph, class, color" />
	<meta name="description" content="Create colored bargraphs with this opensource php class" />
	<link href="default.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
		</script>
		<script type="text/javascript">
		try {
		var pageTracker = _gat._getTracker("UA-2936211-15");
		pageTracker._setDomainName(".osilabs.com");
		pageTracker._trackPageview();
		} catch(err) {}</script>
</head>
<body>
qq;
}

function sectionTitle($title, $descr='') {
	$d = $descr ? "<p>$descr</p>" : '';
	
	return <<<qq
		<h2 class="subtitle">$title</h2>
		$d
qq;
}

function sectionText($text) {
	return "<p>$text</p>";
}

function sectionOutput($o) {
	return <<<qq
		<div style="border:solid orange 2px;background-color:#eee;color:black;">
			$o
		</div>
qq;
}

function sectionCodeAndOutput($code) {
	ob_start();
	$output='';

	echo <<<qq
	<div style="border:dotted orange 1px;background-color:#e6e6e6;color:black;padding:14px;">
			<h4>Output:</h4>
qq;
	eval($code);
	echo '</div>';

	$output = ob_get_clean();
	
	$hl = highlight_string('<?php'.$code."\n?>",true);
	
	return <<<qq
	<div style="border-top:solid orange 2px;border-bottom:dashed orange 1px;background-color:#eee;color:black;padding:9px;">
		$output
		<h4>Sourcecode:</h4>
		<pre><code>$hl</code></pre>
	</div>
qq;
}

?>
